package org.school.streaming;

import java.net.InetAddress;

import org.school.streaming.net.client.Client;
import org.school.streaming.net.client.ClientFrame;

/**
 * @authors Jeffrey Goudzwaard, Davin Terrizzi
 * @version 1.0
 * @date 18-4-2013
 */

/**
 * Start-up class for streaming client
 * @author Davin
 *
 */
public class BootClient {
	
	/**
	 * Start-up method for streaming client
	 * @param	args	First value holds IP address of server
	 * 					Second value holds listening port of server to connect to
	 * 					Third value holds filepath of video to request
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		
		// Initialize GUI
		ClientFrame cf = new ClientFrame();

		// Get server information
		String host = args[0];
		int serverPort = Integer.parseInt(args[1]);
		InetAddress serverIP = InetAddress.getByName(host);
		
		// Set filepath of requested video
		Client.getClient().setVideoFileName(args[2]);

		// Start client
		cf.start(serverPort, host, serverIP);
	}
}
